package com.kgame5.xtank3d.model.tank.comp {
import kgame5.k3d.core.obj3d.node3d.Mesh3D;
import kgame5.k3d.core.obj3d.node3d.animator.Animator3D;
import kgame5.k3d.core.obj3d.node3d.group3d.BestGroup3D;
import kgame5.k3d.core.obj3d.node3d.group3d.FastGroup3D;

import com.kgame5.xtank3d.resource.ResourceManagerX;

/**
 * @author kk
 * 类比于mc,只是持有各个部件而已
 */
public class TankGroup3D extends FastGroup3D{
	public var 
		md_barbG:FastGroup3D,
			md_barb:Animator3D;
	public var 
		md_chasG:BestGroup3D,
			md_body:Mesh3D,
			md_wheelA:Mesh3D,
			md_wheelB:Mesh3D,
			md_wheelC:Mesh3D;
		
	public function TankGroup3D(typeID:int){
		
		
		//底盘
		md_chasG=new BestGroup3D();
		addChild(md_chasG);
		md_body=ResourceManagerX.getInstance().getTankBody(typeID) as Mesh3D;
		md_chasG.addChild(md_body);
		
		md_wheelA=ResourceManagerX.getInstance().getTankWheel(typeID,"A") as Mesh3D;
		md_wheelB=ResourceManagerX.getInstance().getTankWheel(typeID,"B") as Mesh3D;
		md_wheelC=ResourceManagerX.getInstance().getTankWheel(typeID,"C") as Mesh3D;
		
		md_chasG.addChild(md_wheelA);
		md_chasG.addChild(md_wheelB);
		md_chasG.addChild(md_wheelC);
		
		//炮塔
		md_barbG=new FastGroup3D();
		addChild(md_barbG);
		md_barb=ResourceManagerX.getInstance().getTankBarb(typeID) as Animator3D;
		md_barbG.addChild(md_barb);
		
		//设置位置
		md_barbG.y=26+2;
		
		md_wheelA.z=-15;
		md_wheelB.z=0;
		md_wheelC.z=15;
		
		md_wheelA.y=7;
		md_wheelB.y=7;
		md_wheelC.y=7;
	}
}
}
